<template>
	<view>
		
		                        
		
		<uni-card style="border-radius: 12px" note="Tips" >
			<uni-row>
				<uni-col :span="10">
					<br />
				</uni-col>
				<uni-col :span="13">
					<image src="../../static/happy.png" mode="" class="img2"></image>
				</uni-col>
				<uni-col :span="1">
					<image src="../../static/exit.png" mode="" class="img1"></image>
				</uni-col>
				
			</uni-row>
			<view class="text1">点击登录</view>
			
			
			<view class="text2">欢迎来到袁隆平杂交水稻科学园</view>
					
		</uni-card>
		
		<uni-card style="border-radius: 12px" note="Tips">
			<uni-row>
				<uni-col :span="23">
					<view class="text3">
						预约记录
					</view>
				</uni-col>
				<uni-col :span="1">
					<image src="../../static/nextpage.png" mode="" class="img3" @click="success"></image>
					
				</uni-col>
				
			</uni-row>	
			
			<!-- <view v-if="yuyue == undefined"> -->
				
				<uni-row>
					<uni-col :span="7">
						<br />
					</uni-col>
					
					
					<uni-col :span="9">
						<image src="../../static/zwjl.png" mode="" class="img4"></image>
						<view class="text4">
							暂无预约记录
						</view>
					</uni-col>
					<br />
					<uni-col :span="8"></uni-col>
				</uni-row>
			<!-- </view>	
			<view v-else>
				<uni-row class="yuyuetime">
					<uni-col :span="4" class="col-left">
						<image src="../../static/clock.png" class="clock"></image>
					</uni-col>
					<uni-col :span="20">
						<text class="reservation">预约入园时间</text><br>
						<text class="time"> {{yuyue.date}}&nbsp&nbsp{{yuyue.time}} </text>
						
					</uni-col>
				</uni-row>
				<br />
				<br />
				<br />
				<br />
				<br />
				<br />
				<br />
			</view>		 -->	
			
		</uni-card>
		<uni-row>
			<uni-col :span="9">
				<br />
			</uni-col>
			<uni-col :span="10">
				<image src="../../static/hezuo.png" mode="" class="img5"></image>
				<view class="text5">技术支持：电子科技大学</view>
			</uni-col>
			<uni-col :span="5">
				<br />
			</uni-col>
		</uni-row>
				
		
		
		<uni-row class="background">
			<uni-col :span="12">
				<image src="../../static/jl1.png" mode="aspectFit" class="b1" @click="onlineyuyue"></image><br />
				<view class="text6">
					线上预约
				</view>
				
			</uni-col>
			<uni-col :span="12">
				<image src="../../static/xs2.png" mode="" class="b2"></image><br />
				<view class="text7">
					预约记录
				</view>
			</uni-col>
			
		</uni-row>
	</view>
</template>

<script setup>
	import {ref}from'vue'
	//import data from'../../data/data.json'
	
	let yuyue = ref(null)
	uni.getStorage({
	  key: 'timeData',
	  success: function (res) {
	    // 将读取的字符串转回对象
	    yuyue.value = JSON.parse(res.data);
	    console.log(yuyue.value);
	  },
	  fail: function () {
	    console.log('读取表单信息失败');
	  }
	});
	//yuyue.value=data.yuyue
	//console.info(yuyue.value)
	
	let onlineyuyue=function(){
		  uni.redirectTo({
		  	url: '../index/index'
		  });
	}
	let success=function(){
		let tp = 0;
		uni.getStorage({
		  key: 'timeData',
		  success: function (res) {
		    // 将读取的字符串转回对象
		    tp = JSON.parse(res.data);
		  },
		  fail: function () {
		    console.log('读取表单信息失败');
				  uni.showToast({
				  	icon: 'none',
				  	title: '您暂时没有预约记录'
				  });
		  }
		});
		if(tp.type == 1){
				uni.navigateTo({
					//保留当前页面，跳转到应用内的某个页面
					url: '../yy/success'
				})
		}else if(tp.type == 2){
				  uni.navigateTo({
				  	//保留当前页面，跳转到应用内的某个页面
				  	url: '../yy/teamsuccess'
				  })
		}
	}
</script>

<style>
	.img1{
		width: 36rpx;
		height: 36rpx;
	}
	
	.img2{
		width: 100rpx;
		height: 100rpx;
		margin-top: 20rpx;
	}
	.text1{
		
	display: flex;
	font-family: PingFangSC-Medium;
	font-weight: 500;
	font-size: 30rpx;
	color: #000000;
	letter-spacing: 0;
	align-content: center;
	justify-content: center;
	align-items: center;
	margin-top: 10rpx;

	}
	.text2{
	display: flex;	
	opacity: 0.75;
	font-family: PingFangSC-Regular;
	font-weight: 400;
	font-size: 24rpx;
	color: #323232;
	letter-spacing: 0;
	align-content: center;
	justify-content: center;
	align-items: center;
	margin-top: 20rpx;
	margin-bottom: 20rpx;
		
	}
	.text3{
		font-family: PingFangSC-Medium;
		font-weight: 500;
		font-size: 30rpx;
		color: #323232;
		letter-spacing: 0;
		margin-top: 15rpx;
	}
	.img3{
		width: 32rpx;
		height: 32rpx;
		margin-top: 20rpx;
		
	}
	.img4{
		width: 282rpx;
		height: 260rpx;
		margin-top: 200rpx;
		  
	}
	.text4{
		opacity: 0.7;
		font-family: PingFangSC-Regular;
		font-weight: 400;
		font-size: 10px;
		color: #393939;
		letter-spacing: 0;
		margin-left: 85rpx;
		margin-bottom: 210rpx;
	}
	.background{
		background: #FFFFFF;
	}
	.img5{
		width: 135rpx;
		height: 50rpx;
		margin-left: 35rpx;
		margin-top: -10rpx;
	}
	.text5{
		opacity: 0.7;
		font-family: PingFangSC-Regular;
		font-weight: 400;
		font-size: 10px;
		color: #393939;
		letter-spacing: 0;
		margin-left:-8rpx;
		margin-top: 10rpx;
		margin-bottom: 15rpx;
	}
	.b1{
		width: 56rpx;
		height: 56rpx;
		margin-top: 36rpx;
		margin-left: 104rpx;	
		bottom: 2%;
		position: fixed;	
	
	}
	.b2{
		width: 56rpx;
		height: 56rpx;
		margin-top: 36rpx;
		margin-left: 190rpx;
		bottom: 2%;
		position: fixed;
		}
	.text6{
		font-family: PingFangSC-Regular;
		font-weight: 400;
		font-size: 20rpx;
		color: #000000;
		letter-spacing: 0;
		margin-left: 90rpx;
		bottom: 0%;
		position: fixed;
		
	}
	.text7{
		font-family: PingFangSC-Regular;
		font-weight: 400;
		font-size: 20rpx;
		color: #393939;
		letter-spacing: 0;
		margin-left: 176rpx;
		bottom: 0%;
		position: fixed;
	}
	.reservation{
		width: 72px;
		height: 17px;
		font-family: PingFangSC-Regular;
		font-weight: 400;
		font-size: 12px;
		color: #000000;
		letter-spacing: 0;
	}
	.time{
		width: 212px;
		height: 21px;
		font-family: PingFangSC-SNaNpxibold;
		font-weight: 600;
		font-size: 15px;
		color: #000000;
		letter-spacing: 0;
	}
	.clock{
		width: 38px;
		height: 38px;
		/*opacity: 0;*/
	}
	.yuyuetime{
		margin-top: 30rpx;
	}
		  
</style>
